package com.edu.system.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.edu.common.annotation.Excel;
import com.edu.common.core.domain.BaseEntity;

/**
 * 消费记录对象 t_charge_record
 *
 * @author xxxx
 * @date 2023-12-22
 */

@Data
public class TChargeRecord extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    private Long canteenId;


    /**
     * 持卡人
     */
    @Excel(name = "姓名")
    private String ownerName;

    /**
     * 工号/学号
     */
    @Excel(name = "教育ID")
    private String ownerId;

    @Excel(name = "班级")
    private String className;

    /**
     * 卡号
     */
    @Excel(name = "卡号")
    private String cardNo;

    /**
     * 消费金额
     */
    @Excel(name = "消费金额")
    private Float amount;

    /**
     * 消费后卡余额
     */
    private Float balance;

    /**
     * 消费类型
     */
    @Excel(name = "消费类型")
    private String chargeType;

    /**
     * 消费时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "消费时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date chargeTime;

    /**
     * 消费单号
     */
    @Excel(name = "消费单号")
    private String billNo;

    // 非数据库字段
    @Excel(name = "食堂")
    private String canteenName;

    private Integer cardType;

    private Long classId;
    private String cohort;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    /**
     * 在线还是离线刷卡
     */
    private String isOnline;

    private String generation;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("canteenId",getCanteenId())
                .append("ownerName", getOwnerName())
                .append("ownerId", getOwnerId())
                .append("cardNo", getCardNo())
                .append("amount", getAmount())
                .append("balance", getBalance())
                .append("chargeType", getChargeType())
                .append("chargeTime", getChargeTime())
                .append("billNo", getBillNo())
                .append("isOnline", getIsOnline())
                .toString();
    }
}
